<%@ page language="java" contentType="text/html; charset=utf-8"
	pageEncoding="utf-8"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/fmt" prefix="f"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<!--<!DOCTYPE html PUBLIC "-//W3C//DTD /TML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">-->
<!DOCTYPE >
<html lang="zh-CN">

<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<link rel="stylesheet" href="${pageContext.request.contextPath}/Sources/bootstrap/css/bootstrap.css" />
 <link rel="stylesheet"
	href="${pageContext.request.contextPath}/Sources/css/business/list.css"> 
<link rel="stylesheet"
	href="${pageContext.request.contextPath}/Sources/css/general/page.css"> 
<title>Insert title here</title>

</head>

<body>
<script>
$(function(){	
	$("#searchbutton").click(function(){
		var search=$("#search").val();		
		$(this).attr("url","user/list?search="+search);
	})
})
</script>
	<div class="container col-lg-12 user_div">
		<div class="row div-top">
		<div class="col-lg-1"></div>
			<form action="user/list" method="get" id="searchform">
				<div class="col-lg-1 ">
				<input type="hidden" id="user_url" value="${url}"/>
				<input type="hidden" id="tabid" value="${tabid}"/>
				</div>
				<div class="col-lg-6">
					<input type="text" width="200px" name="search" id="search"
						class="form-control input-ml" placeholder="查询LastName" />
				</div>
				<div class="col-lg-2">

					<button type="buttom" class="btn btn-primary btn-ml" data-addtab="2" ajax='true' id="searchbutton" title="用户管理" >
						<span class="glyphicon glyphicon-search"></span> Search
					</button>
				</div>
			</form>
		</div>
		<div class="row div-table">
			<div class="col-lg-1 "></div>
			<div class="col-lg-10" >
				<table class="table table-striped table-bordered table-hover">
					<thead>

						<tr>
							<th>LastName</th>
							<th>Email</th>
							<th>Birth</th>
							<th>CreateTime</th>
							<th>Department</th>
							<th>Actor</th>
							<th colspan="2">Operation</th>
						</tr>
					</thead>
					<tbody>
						<c:forEach items="${employees.getContent()}" var="item">
							<tr>
								<td>${item.lastName }</td>
								<td>${item.email}</td>
								<td>${item.birth}</td>
								<td>${item.createTime }</td>
								<td>${item.department.departmentName}</td>
								<td>${item.actor.name }</td>
								<td><a data-toggle="modal" class="usermodify" data-target="#updateModal" usermodify="user/update/${item.id}" style="cursor: pointer;">修改</a></td>
								<td><a style="cursor:pointer;" class="userdel" methodurl="user/Del/${item.id}" data-toggle="modal" data-target="#deluserModal">删除</a></td>
							</tr>
						</c:forEach>
					</tbody>
				</table>
			</div>
		</div>
		<div class="row div-foot">
			<div class="col-lg-1"></div>
			<div class="col-lg-1  div-add"> 
				  <a class="btn btn-primary btn-ml" data-toggle="modal" data-target="#userAddModal" usermodify="user/input">		
				<span class="glyphicon glyphicon-plus"></span></a>
			</div>
			<div class="col-lg-3" ></div>
			<div class="col-lg-6  div-page ">
				<nav>
					<ul class="pagination" id="user_page" >
					</ul>
				</nav>

			</div>
		</div>   
	</div>
	<!-- 模态框（Modal） -->
	<script >
	
	
</script>
	
	<script type="text/javascript" src="${pageContext.request.contextPath}/Sources/js/tools/jquery-1.11.3.min.js"></script>
	<!--  <script type="text/javascript" src="${pageContext.request.contextPath}/Sources/bootstrap/js/bootstrap.js"></script>-->	
	<script type="text/javascript"
		src="${pageContext.request.contextPath}/Sources/js/general/url.js"></script>
	 <script type="text/javascript"
		src="${pageContext.request.contextPath}/Sources/js/general/page.js"></script>
	<script type="text/javascript"
		src="${pageContext.request.contextPath}/Sources/js/general/newmodal.js"></script>
		<script type="text/javascript"
		src="${pageContext.request.contextPath}/Sources/js/business/user/ulist.js"></script>
	<script type="text/javascript">	
	$(function() {
		var param={
				num:${employees.getTotalPages()},//总页数
				tag:$("#user_url").val(),//url
				pageno:${pageNo},//当前页数
				tabid:'2',//跳转到目标页的tabpanel的id
				type:"0"//是否在tabpanel中，0为在，1为不在
		};
		console.log(param);
				$(document).ready(function() {	
					$("#user_page").createpage(param);			
				})
		
	})
	</script>
</body>

</html>